//
//  UIAlertController+alert.m
//  yunxingshi
//
//  Created by 李园园 on 17/3/3.
//  Copyright © 2017年 李园园. All rights reserved.
//

#import "UIAlertController+alert.h"
#import <objc/runtime.h>
@implementation UIAlertController (alert)

+(void)exchangeMethod{
    
    /** 获取原始setMessage方法 */
    Method originalM = class_getInstanceMethod([self class], @selector(setMessage:));
    
    /** 获取自定义的new_setMessage方法 */
    Method exchangeM = class_getInstanceMethod([self class], @selector(new_setMessage:));
    
    /** 交换方法 */
    method_exchangeImplementations(originalM, exchangeM);
}

/** 自定义的方法 */
-(void)new_setMessage:(NSString *)message{
    [self new_setMessage:@"加载完毕"];
}


@end
